package hyperNexus

// 框架核心类
import (
	"HyperNexus/common/logger"
	"HyperNexus/hyperNexus/config"
	"HyperNexus/hyperNexus/defines"
	"context"
	"github.com/gogf/gf/v2/os/gctx"
)

type HyperNexus struct {
	ctx       gctx.Ctx
	loggerIns *logger.HyperNexusLogger
}

func NewHyperNexus() *HyperNexus {
	return &HyperNexus{
		loggerIns: nil,
	}
}

func (h *HyperNexus) initialize() {
	h.initLogger()
}

func (h *HyperNexus) initLogger() {
	logConfig, err := config.HyperNexusConfigMaster().GetHyperNexusValue(context.TODO(), defines.CONFIG_LOG)
	if err != nil {
		panic(err)
	}
	h.loggerIns = logger.NewHyperNexusLogger(logConfig.Val().(map[string]interface{}))
	h.loggerIns.Debug(h.ctx, "hyperNexus logger init success")
}

func (h *HyperNexus) Start() {
	h.initialize()
}

func (h *HyperNexus) Stop() {

}
